{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "5532220d-93de-4728-99df-1abf7c7f0e54",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pytest"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "34062323-5acd-4926-8f3c-6501aaac6adb",
   "metadata": {},
   "outputs": [],
   "source": [
    "testdata = [\n",
    "    (\"a,b,c\", \"a,b,c\"),\n",
    "    (\"a,b,c\", \"a,b\"),\n",
    "]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2985ac6d-c478-49c8-80f0-99e0793cc7fd",
   "metadata": {},
   "outputs": [],
   "source": [
    "def compare(v1,v2):\n",
    "    a = frozenset(v1.split(\",\"))\n",
    "    b = frozenset(v2.split(\",\"))\n",
    "    return not (b.issubset(a) or a.issubset(b))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "a3384c89-3e44-49fd-8196-a96e1c45be61",
   "metadata": {},
   "outputs": [],
   "source": [
    "@pytest.mark.parametrize(\"v1,v2\", testdata)\n",
    "def test_compare(v1,v2):\n",
    "    assert compare(v1,v2)==True\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f51a6637-d367-4e34-b63c-10450c49db15",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "28ef7b4a-574f-489a-9185-d5ec66fee111",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "False\n"
     ]
    }
   ],
   "source": [
    "test_compare(v1,v2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "273ed46e-9813-40c1-8aaf-15af24361329",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Py(Python note)",
   "language": "python",
   "name": "pynote"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
